home *** CD-ROM | disk | FTP | other *** search
/ Champak 49 / Volume 49 - JOGO DISK .iso / Games / hight-d.swf / scripts / frame_112 / DoAction.as < prev   
Encoding:
Text File  |  2007-10-01  |  2.4 KB  |  123 lines

  1. function thegame()
  2. {
  3.    var _loc1_ = _root;
  4.    if(_loc1_.round >= 12)
  5.    {
  6.       _loc1_.score += 10000;
  7.       gotoAndStop(122);
  8.    }
  9.    clearInterval(thegameID);
  10.    thegameID = setInterval(thegame,20 - _loc1_.round - _loc1_.speedup);
  11.    echeck = 1;
  12.    while(echeck < 6)
  13.    {
  14.       if(_loc1_.player.hitTest("_root.enemys.e" add echeck) && death_c != true)
  15.       {
  16.          clearInterval(thegameID);
  17.          death_c = true;
  18.          tellTarget("_root.player")
  19.          {
  20.             gotoAndStop("death");
  21.             play();
  22.          }
  23.       }
  24.       echeck++;
  25.    }
  26.    if(go_normal > 10 && death_c != true)
  27.    {
  28.       go_normal = 0;
  29.       tellTarget("_root.player.pos")
  30.       {
  31.          gotoAndStop(1);
  32.       }
  33.    }
  34.    if(_loc1_.life < 1)
  35.    {
  36.       clearInterval(thegameID);
  37.       gotoAndStop(119);
  38.    }
  39.    if(Key.isDown(Key.left))
  40.    {
  41.       player.xspeed -= 6;
  42.    }
  43.    if(Key.isDown(Key.right))
  44.    {
  45.       player.xspeed += 6;
  46.    }
  47.    if(Key.isDown(Key.space))
  48.    {
  49.       if(player.jump && death_c != true)
  50.       {
  51.          tellTarget(_loc1_.sounds)
  52.          {
  53.             gotoAndPlay(2);
  54.          }
  55.          player.yspeed -= player.jumpHeight;
  56.          tellTarget("player.pos")
  57.          {
  58.             gotoAndStop(2);
  59.          }
  60.          player.jump = false;
  61.       }
  62.    }
  63.    if(!Key.isDown(Key.down))
  64.    {
  65.    }
  66.    player.xspeed *= 0.5;
  67.    player.yspeed += gravity;
  68.    if(player.yspeed > gravity && death_c != true)
  69.    {
  70.       tellTarget("player.pos")
  71.       {
  72.          gotoAndStop(3);
  73.       }
  74.    }
  75.    if(death_c != true)
  76.    {
  77.       x = player._x + player.xspeed;
  78.       y = player._y + player.yspeed;
  79.    }
  80.    if(bkg.hittest(x,player._y,true))
  81.    {
  82.       player._x = x;
  83.    }
  84.    else
  85.    {
  86.       player.xspeed = 0;
  87.       if(death_c != true)
  88.       {
  89.          tellTarget("_root.player.pos")
  90.          {
  91.             gotoAndStop(1);
  92.          }
  93.       }
  94.    }
  95.    if(bkg.hittest(player._x,y,true))
  96.    {
  97.       player._y = y;
  98.    }
  99.    else
  100.    {
  101.       if(player.yspeed < 0 && death_c != true)
  102.       {
  103.          tellTarget("_root.player.pos")
  104.          {
  105.             gotoAndStop(1);
  106.          }
  107.       }
  108.       else
  109.       {
  110.          if(death_c != true)
  111.          {
  112.             tellTarget("_root.player.pos")
  113.             {
  114.                gotoAndStop(1);
  115.             }
  116.          }
  117.          go_normal += 1;
  118.          player.jump = true;
  119.       }
  120.       player.yspeed = 0;
  121.    }
  122. }
  123.